% Answer to the question no.11.2a of Lab Manual
% Plotting the relation between the number of heads k and the probability
function LM11_2a
k=500:1:700;
p=zeros(1,201);
for i=1:1:200
    p(i)=nchoosek(1000,k(i))*0.6^k(i)*0.4^(1000-k(i));   % Using the formula to calculate the probability dirrectly
end
figure;
plot(k,p);
xlabel('The number of heads');ylabel('The probability');

end

